#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <time.h>
using namespace std;

int main()
{
	int arr[6] = { 3,2,7,5,6,8 };
	int z = sizeof(arr) / sizeof(arr[0]);
	int j = 0;
	for (j = 0; j < z - 1; j++)
	{
		int i = 0;
		for (i = 0; i < z - 1; i++)
		{
			if (arr[i] > arr[i + 1])
			{
				int e = arr[i];
				arr[i] = arr[i + 1];
				arr[i + 1] = e;
			}
		}
	}
	int k = 0;
	for (k = 0; k < z; k++)
	{
		cout << arr[k] << endl;
	}
	return 0;
}